#include "C_SlideShow.h"
#include "VC_GameState.h"
#include "C_GS_MainMenu.h"
#include "C_FSM.h"

C_SlideShow::C_SlideShow()
{
}


C_SlideShow::~C_SlideShow()
{
}

void C_SlideShow::render()
{
	if (m_slides.size() != 0)
	{
		m_slides.top()->render();
	}
}
void C_SlideShow::update()
{
	if (m_slides.size() == 0)
	{
		VC_GameState::fsm()->setChangeState(new C_GS_MainMenu());
	}

	if (m_slides.top()->isEnd())
	{
		m_slides.pop();
		if (m_slides.size() != 0) m_slides.top()->show();
	}

	if (m_slides.size() != 0)
	{
		m_slides.top()->update();
	}
}

void C_SlideShow::handleEvent(sf::Event e)
{
	VC_Drawable::handleEvent(e);
	if (m_slides.size() != 0)
	{
		m_slides.top()->handleEvent(e);
	}
}
